#include "access_control_entry.h"

AUTH_NS_START

AccessControlEntry::AccessControlEntry(std::string& filename,
                                       const FtpUser* user, AccessRightFlags accessRights, bool isPositiveRight)
	:m_nFilename(filename), m_bIsPositive(isPositiveRight) {
	this->m_bIsRightForGroup = false;
	this->m_nUserSid = user->GetSid();
	this->m_nAccessRights = (AccessRightFlags)(accessRights & ~(INVALID_ACCESS_RIGHT_VALUE -1 ));
}

AccessControlEntry::AccessControlEntry(std::string& filename,
                                       const FtpGroup* grp, AccessRightFlags accessRights, bool isPositiveRight)
	:m_nFilename(filename), m_bIsPositive(isPositiveRight) {
	this->m_bIsRightForGroup = true;
	this->m_nGroupSid = grp->GetGid();
	this->m_nAccessRights = (AccessRightFlags)(accessRights & ~(INVALID_ACCESS_RIGHT_VALUE -1 ));
}

AccessControlEntry::~AccessControlEntry() {
}

AUTH_NS_END
